package com.shop.controller.admin;

import com.shop.entity.CommentsReply;
import com.shop.result.Result;
import com.shop.service.CommentsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin/commentsReply")
@Slf4j
@Api(tags = "评论相关接口")
public class CommentsReplyController {

    @Autowired
    private CommentsService commentsService;

    /**
     * 增加回复
     * @param commentsReply
     */
    @PostMapping("/save")
    @ApiOperation("增加回复")
    public Result save(CommentsReply commentsReply) {
        log.info("增加回复");
        commentsService.saveReply(commentsReply);
        return Result.success();
    }

    /**
     * 按照店铺id查看评论
     * @param commentsReply
     * @return
     */
    @GetMapping("/pageQuery")
    @ApiOperation("按照店铺id查看评论")
    public Result pageQuery(CommentsReply commentsReply) {
        log.info("按照店铺id查看评论");
        return null;
    }
}
